package com.xyh.student.utils;

import java.util.ArrayList;
import java.util.List;

public class DeleteNull {
    public static String[] deleteNull(String[] strings) {
        List<String> list = new ArrayList<String>();
        for (String s : strings) {
            list.add(s);
        }
        for (int i = 0; i < list.size(); i++) {
            if (strings[i].equals("null") || strings[i].equals("")) {
                list.remove(i);
            }
        }
        //System.out.println(list.size());
        String[] newStr = new String[list.size() - 1];
        for (int i = 0; i < list.size() - 1; i++) {
            //System.out.println(list.get(i));
            newStr[i] = list.get(i);
        }
        return newStr;
    }
}
